﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 工业设备监控系统.Models
{
    public class Alarm
    {
        public int Id { get; set; }
        public string DeviceName { get; set; } = string.Empty;
        public string RegisterName { get; set; } = string.Empty;
        public string Message { get; set; } = string.Empty;       // 如 "温度过高"

        public string Level { get; set; } = "Warning";           // Warning, Error, Critical
        public double Value { get; set; }                       // 超限值
        public double Threshold { get; set; }                   // 阈值（如 > 80°C）

        public DateTime TriggerTime { get; set; } = DateTime.Now;
        public DateTime? ClearTime { get; set; }                // 清除时间
        public bool IsCleared { get; set; } = false;
        public string ClearedBy { get; set; } = string.Empty;    // 操作员姓名

        // 可选：关联寄存器
        public int? RegisterId { get; set; }
    }
}